<!doctype html>
<html lang="zh">
<head>
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1, user-scalable=no">
    <link rel="icon" href="../dist/img/favicon-32x32.png" sizes="32x32" type="image/png">
    <link rel="icon" href="../dist/img/favicon-16x16.png" sizes="16x16" type="image/png">
    <meta name="keywords" content="响应式后台模板,开源免费后台模板,Bootstrap5后台管理系统模板">
    <meta name="description" content="bootstrap-admin基于bootstrap5的免费开源的响应式后台管理模板">
    <meta name="author" content="ajiho">
    <link rel="stylesheet" href="../lib/bootstrap-icons/font/bootstrap-icons.min.css">
    <link rel="stylesheet" href="../lib/bootstrap/dist/css/bootstrap.min.css">
    <link rel="stylesheet" href="../dist/css/bootstrap-admin.min.css">
    <title>bootstrap-admin开源免费响应式后台管理系统模板</title>
</head>
<body class="bg-body-tertiary py-3">
<div class="container-fluid">
    <!--  正文内容放置在此处  -->

    <!--  为了美观,建议大家都把新内容都放card组件里面  -->
    <div class="card border-0 shadow-sm">
        <div class="card-header bg-body">
            新页面标题
        </div>
        <div class="card-body">
            <div class="row">

                <div class="col-12">
                    <div class="input-group mb-3">
                        <input type="text" class="form-control" id="input1" value="bootstrap-admin让我开发后台很快">
                        <button class="btn btn-outline-secondary" type="button" id="btn1"
                                data-clipboard-target="#input1">复制
                        </button>
                    </div>
                </div>

                <div class="col-12">
                    <div class="mb-3">
                        <label for="exampleFormControlTextarea1" class="form-label">尝试粘贴到此处</label>
                        <textarea class="form-control" id="exampleFormControlTextarea1" rows="3"></textarea>
                    </div>
                </div>

            </div>
        </div>
    </div>

    <!--回到顶部开始-->
    <a href="javaScript:" class="bsa-back-to-top"><i class='bi bi-arrow-up-short'></i></a>
    <!--回到顶部结束-->

</div>

<script src="../lib/bootstrap/dist/js/bootstrap.bundle.min.js"></script>
<script src="../lib/jquery/dist/jquery.min.js"></script>
<script src="../lib/clipboard/dist/clipboard.min.js"></script>
<script src="../dist/js/bootstrap-admin.min.js"></script>
<script src="../dist/js/app.js"></script>
<script>
    $(document).ready(function (e) {
        //你的逻辑

        let clipboard = new ClipboardJS('#btn1');
        //事件监听
        clipboard.on('success', function (e) {
            // 清除选中状态
            e.clearSelection();
            $.toasts({
                type: 'success',
                content: '复制成功'
            })

        });
        //复制失败事件
        clipboard.on('error', function () {
            $.toasts({
                type: 'danger',
                content: '复制失败'
            })
        });
        //鼠标移出隐藏提示(可能用到的方法)
        // $('.copy').mouseleave(function () {

        // });

    })
</script>
</body>
</html>